

<!DOCTYPE html>
<html lang class="loading">
<head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>上传文件到GitHub上的两种方法（纯新手可以看看） - 闲看花开 静待花落</title>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate">
    <meta name="keywords" content="贰货不二,"> 
    <meta name="description" content="一、GitHub官网上传 这种方法有一定局限性:对上传的文件数有限制
1.1、登陆GitHub官网 
1.2、新建存储库   第一次建的库如下，点击箭头所指（跳1.3） 
 已经有的库直接如下图上传,"> 
    <meta name="author" content="贰货不二"> 
    <link rel="alternative" href="atom.xml" title="闲看花开 静待花落" type="application/atom+xml"> 
    <link rel="icon" href="/img/favicon.png"> 
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
    <link rel="stylesheet" href="/css/diaspora.css">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({
              google_ad_client: "ca-pub-8691406134231910",
              enable_page_level_ads: true
         });
    </script>
    <script async custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js">
    </script>
    
</head>
</html>
<body class="loading">
    <span id="config-title" style="display:none">闲看花开 静待花落</span>
    <div id="loader"></div>
    <div id="single">
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div id="top" style="display: block;">
    <div class="bar" style="width: 0;"></div>
    <a class="icon-home image-icon" href="javascript:;" data-url="https://mrdcg.github.io"></a>
    <div title="播放/暂停" class="icon-play"></div>
    <h3 class="subtitle">上传文件到GitHub上的两种方法（纯新手可以看看）</h3>
    <div class="social">
        <!--<div class="like-icon">-->
            <!--<a href="javascript:;" class="likeThis active"><span class="icon-like"></span><span class="count">76</span></a>-->
        <!--</div>-->
        <div>
            <div class="share">
                <a title="获取二维码" class="icon-scan" href="javascript:;"></a>
            </div>
            <div id="qr"></div>
        </div>
    </div>
    <div class="scrollbar"></div>
</div>

    <div class="section">
        <div class="article">
    <div class='main'>
        <h1 class="title">上传文件到GitHub上的两种方法（纯新手可以看看）</h1>
        <div class="stuff">
            <span>七月 07, 2019</span>

            <span>
   阅读数(请刷新)<span id="busuanzi_value_page_pv"></span>
</span>
            
  <ul class="post-tags-list"><li class="post-tags-list-item"><a class="post-tags-list-link" href="/tags/操作/">操作</a></li></ul>



        </div>
        <div class="content markdown">
            <h2 id="一、GitHub官网上传"><a href="#一、GitHub官网上传" class="headerlink" title="一、GitHub官网上传"></a><a href></a>一、GitHub官网上传</h2><p> 这种方法有一定局限性:对上传的文件数有限制</p>
<h3 id="1-1、登陆GitHub官网"><a href="#1-1、登陆GitHub官网" class="headerlink" title="1.1、登陆GitHub官网"></a><a href></a>1.1、登陆<a href="https://github.com/" target="_blank" rel="noopener">GitHub</a>官网</h3><p> <img src="https://i.loli.net/2019/07/08/5d2303152965111633.png" alt></p>
<h3 id="1-2、新建存储库"><a href="#1-2、新建存储库" class="headerlink" title="1.2、新建存储库"></a><a href></a>1.2、新建存储库</h3><p> <img src="https://i.loli.net/2019/07/08/5d23033aed1c521466.png" alt><br> <img src="https://i.loli.net/2019/07/08/5d23034a2019285078.png" alt><br> 第一次建的库如下，点击箭头所指（跳1.3）<br> <img src="https://i.loli.net/2019/07/08/5d2303664300559051.png" alt></p>
<p> 已经有的库直接如下图上传<img src="https://i.loli.net/2019/07/08/5d23037a6089b15275.png" alt></p>
<h3 id="1-3、上传文件"><a href="#1-3、上传文件" class="headerlink" title="1.3、上传文件"></a><a href></a>1.3、上传文件</h3><p> <img src="https://i.loli.net/2019/07/08/5d23038abb14580481.png" alt></p>
<h2 id="二、Git-Bash-上传"><a href="#二、Git-Bash-上传" class="headerlink" title="二、Git Bash 上传"></a><a href></a>二、Git Bash 上传</h2><h3 id="2-1、Git-Bash下载"><a href="#2-1、Git-Bash下载" class="headerlink" title="2.1、Git Bash下载"></a><a href></a>2.1、Git Bash下载</h3><p> 进入<a href="https://www.git-scm.com/downloads" target="_blank" rel="noopener">git bash</a>官网下载<br> <img src="https://i.loli.net/2019/07/08/5d2303a96159494433.png" alt><br> 我这里下载64位的<br> <img src="https://i.loli.net/2019/07/08/5d2303bea2a0059592.png" alt><br> 完后直接安装就行（一路到底的next），这里就不说了</p>
<h3 id="2-2、Git-Bash文件上传"><a href="#2-2、Git-Bash文件上传" class="headerlink" title="2.2、Git Bash文件上传"></a><a href></a>2.2、Git Bash文件上传</h3><h3 id="注意：因为我之前已经登陆过GitHub账号了，所以在接下来的操作中我就不用登陆了；没登陆的也可以按着下面步骤走，在进行下面的操作时应该会弹出登陆界面，直接输入你的GitHub账号跟密码就行，也有可能出现的是命令符（username和password），直接在后面输入你的GitHub账号跟密码就行"><a href="#注意：因为我之前已经登陆过GitHub账号了，所以在接下来的操作中我就不用登陆了；没登陆的也可以按着下面步骤走，在进行下面的操作时应该会弹出登陆界面，直接输入你的GitHub账号跟密码就行，也有可能出现的是命令符（username和password），直接在后面输入你的GitHub账号跟密码就行" class="headerlink" title="#注意：因为我之前已经登陆过GitHub账号了，所以在接下来的操作中我就不用登陆了；没登陆的也可以按着下面步骤走，在进行下面的操作时应该会弹出登陆界面，直接输入你的GitHub账号跟密码就行，也有可能出现的是命令符（username和password），直接在后面输入你的GitHub账号跟密码就行"></a><a href></a>#注意：因为我之前已经登陆过GitHub账号了，所以在接下来的操作中我就不用登陆了；没登陆的也可以按着下面步骤走，在进行下面的操作时应该会弹出登陆界面，直接输入你的GitHub账号跟密码就行，也有可能出现的是命令符（username和password），直接在后面输入你的GitHub账号跟密码就行</h3><p> 先在GitHub上新建一个库（如上）<br> 打开Git Bash<br> <img src="https://i.loli.net/2019/07/08/5d2303de0205618931.png" alt><br> 输入你想上传的文件的目录<br> 格式：cd D:\文件名<br> cd 下一级文件<br> <img src="https://i.loli.net/2019/07/08/5d23040db96b453335.png" alt><br> 输入：git init<br> <img src="https://i.loli.net/2019/07/08/5d2304320cb4327529.png" alt><br> 输入：git add . （”.“代表该目录下的所有文件，如果不想上传所有文件，把”.”换成想要上传的文件名）<br> <img src="https://i.loli.net/2019/07/08/5d2304466659397665.png" alt><br> 输入：git commit -m ‘first’（first可任意换，相当于描述）<img src="https://i.loli.net/2019/07/08/5d23045d0d74496236.png" alt><br> 接下来这里需要进入新建的库<br> <img src="https://i.loli.net/2019/07/08/5d230473a69e971321.png" alt><br> 如果已经有库：<br> <img src="https://i.loli.net/2019/07/08/5d23049f3d3f871741.png" alt><br> 输入：git remote add origin <a href="https://github.com/xxx/vvv.git%EF%BC%88%E8%BF%99%E9%87%8C%E7%9A%84%E8%BF%9E%E6%8E%A5%E5%B0%B1%E6%98%AF%E4%B8%8A%E9%9D%A2%E5%A4%8D%E5%88%B6%E7%9A%84%EF%BC%89" target="_blank" rel="noopener">https://github.com/xxx/vvv.git（这里的连接就是上面复制的）</a><br> <img src="https://i.loli.net/2019/07/08/5d2304c2109fb35971.png" alt><br> 输入：git push -u origin master<br> <img src="https://i.loli.net/2019/07/08/5d2304e38521928383.png" alt><br> 如果出现错误：<br> <img src="https://i.loli.net/2019/07/08/5d2304fa9248199684.png" alt><br> 这是因为本地文件中没有库里已存在的项目，需要将本地没有的项目pull到本地文件<br> 输入：git pull –rebase origin master<br> 完成后再输入：git push origin master就行了<br> 这里就上传完成了</p>
<p> 打开GitHub<br> <img src="https://i.loli.net/2019/07/08/5d23050deca1376626.png" alt></p>

            <!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
            <audio id="audio" loop="1" preload="auto" controls="controls" data-autoplay="false">
                <source type="audio/mpeg" src="http://link.hhtjim.com/163/1373236574.mp3">
            </audio>
            
        </div>
        
        
    <div id='gitalk-container' class="comment link"
        data-ae='false'
        data-ci='e79d3ae9c45da13e6f66'
        data-cs='896cb16e937a9e56f91295c1bab9e5aad59746ad'
        data-r='MrDCG.github.io'
        data-o='MrDCG'
        data-a='MrDCG'
        data-d='true'
    >查看评论</div>


        
    </div>

    
    
</div>

    </div>
</div>

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/assets/koharu.model.json"},"display":{"position":"right","width":145,"height":315},"mobile":{"show":true,"scale":0.5},"react":{"opacityDefault":0.7,"opacityOnHover":0.8},"log":false});</script></body>
<script src="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script src="//lib.baomitu.com/jquery/1.8.3/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/diaspora.js"></script>
<link rel="stylesheet" href="/photoswipe/photoswipe.css">
<link rel="stylesheet" href="/photoswipe/default-skin/default-skin.css">
<script src="/photoswipe/photoswipe.min.js"></script>
<script src="/photoswipe/photoswipe-ui-default.min.js"></script>

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>




</html>
<!--崩溃欺骗-->
<script type="text/javascript" src="/js/crash_cheat.js"></script>
<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/clicklove.js"></script>